<script type="text/javascript">
    $(document).ready(function() {
        $(".linkxoa").live('click', function() {
            var flag = confirm("Bạn có chắc chắn xóa");
            if (flag == true) {
                var kg_id = $(this).attr("kg_id");
                $.get('xoa.php', {loai: "khoanggia", id: kg_id}, function(data) {
                    window.location.reload();
                });
            }
        })
    })
</script>

<div id="admin_navigation">
    <div style="float:left;width:80%">
        <h3>Quản lý khoảng giá : Xem danh sách</h3>
    </div>
    <div style="float:left;width:5%;padding-top:5px">
        <a href="index.php?com=khoanggia_add"><input type="button" class="new" name="btnNew" value=""/></a><br />
        <span>New</span>
    </div>
    <div style="float:left;width:5%;padding-top:5px">
        <input type="submit" class="save" name="btnSumit" value=""/><br />
        <span>Save</span>
    </div>
    <div style="float:left;width:5%;padding-top:5px">
        <input type="reset" class="cancel" name="btnCancel" value=""/><br />
        <span>Reset</span>
    </div>
    <div class="clr"></div>
</div>
<div id="main_admin">

    <div>
        <fieldset>
            <legend>++ Khoảng giá ++</legend>
            <div style="text-align: center">
                <table id="rounded-corner" summary="2007 Major IT Companies&#39; Profit">
                    <thead>
                        <tr style="background-color:#03F;color:#FFF;height:30px">
                            <th scope="col" class="rounded-company"></th>

                            <th scope="col" class="rounded">Giá từ</th>       
                            <th scope="col" class="rounded">Giá đến</th>       

                            <th scope="col" class="rounded">Sửa</th>
                            <th scope="col" class="rounded-q4">Xóa</th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php
                        $kieu = $kieu->getListKhoangGia();
                        while ($row = mysql_fetch_assoc($kieu)) {
                            $i++;
                            ?>
                            <tr <?php if ($i % 2 == 0) echo "bgcolor='#CCC'"; ?>>
                                <td><input type="checkbox" name="chon" kieu_id=<?php echo $row['kg_id'] ?>></td>
                                <td align="right"><?php echo number_format($row['giatu']) ?></td>
                                <td align="right"><?php echo number_format($row['giaden']); ?></td>
                                <td><a href="index.php?com=khoanggia_edit&amp;kg_id=<?php echo $row['kg_id'] ?>"><img src="img/icons/user_edit.png" alt="" title="" border="0"></a></td>
                                <td><img class="linkxoa" kg_id=<?php echo $row['kg_id'] ?> src="img/icons/trash.png" alt="" title="" border="0"></td>
                            <?php } ?>
                    </tbody>
                </table>
            </div>
        </fieldset>
    </div>


    <div class="clr"></div>
</div>
